package com.oamicnet.boot.validation.controller.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

@Schema(name = "UserDTO", description = "用户实体")
@Data
public class UserDTO {
    @Schema(description = "用户ID", example = "1001", requiredMode = REQUIRED)
    @NotNull(message = "ID不能为空")
    private Long id;

    @Schema(description = "用户名", minLength = 1, maxLength = 5)
    @NotBlank(message = "用户名不能为空")
    @Size(min = 1,max = 5,message = "长度为1-5字符")
    private String name;
}
